home *** CD-ROM | disk | FTP | other *** search
- //: C02:Stream2.cpp
- // From Thinking in C++, 2nd Edition
- // Available at http://www.BruceEckel.com
- // (c) Bruce Eckel 1999
- // Copyright notice in Copyright.txt
- // More streams features
- #include <iostream>
- using namespace std;
-
- int main() {
- // Specifying formats with manipulators:
- cout << "a number in decimal: "
- << dec << 15 << endl;
- cout << "in octal: " << oct << 15 << endl;
- cout << "in hex: " << hex << 15 << endl;
- cout << "a floating-point number: "
- << 3.14159 << endl;
- cout << "non-printing char (escape): "
- << char(27) << endl;
- } ///:~
-